package com.supor.aiot.common.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * ---------------------------------------------------------------- <br>
 * Copyright (C) 2014-2020, by het, Shenzhen, All rights reserved.  <br>
 * ---------------------------------------------------------------- <br>
 * <p>
 * 描述: RecordBean <br>
 * 作者: lei <br>
 * 日期: 2020/12/8 <br>
 */
public class RecordBean implements Parcelable {
    /**
     * 产品ID，AIoT产品中心分配, 4字节
     */
    String productId = "";
    /**
     * 产品的防串货码，每次WiFi模块上电要通过电控进行初始化（17 字节）
     */
    String sn = "";
    /**
     * WiFi模块的 MAC 地址（12位 6字节）
     */
    String wifiMac = "";
    /**
     * NFC唯一码（14位 7字节）
     */
    String uid = "";
    /**
     * WiFi模块当前是否连接可用路由器（0/1，1 字节）
     */
    String isWifiConnect;
    /**
     * 手机触碰 NFC 的累计数（4 字节，最大 65535），作为 NFC+WiFi 模块的属性字段由 WiFi 模块计数上报。
     */
    String count;
    /**
     * 故障代码，AIoT产品中心配置, 默认0，uint 1字节
     */
    String error;
    /**
     * 配件状态
     */
    String cValue;

    public RecordBean() {
    }

    public RecordBean(String sn, String wifiMac, String isWifiConnect, String count) {
        this("", sn, wifiMac, isWifiConnect, count);
    }

    public RecordBean(String productId, String sn, String wifiMac, String isWifiConnect, String count) {
        this.productId = productId;
        this.sn = sn;
        this.wifiMac = wifiMac;
        this.isWifiConnect = isWifiConnect;
        this.count = count;
    }

    protected RecordBean(Parcel in) {
        productId = in.readString();
        sn = in.readString();
        wifiMac = in.readString();
        uid = in.readString();
        isWifiConnect = in.readString();
        count = in.readString();
        error = in.readString();
        cValue = in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(productId);
        dest.writeString(sn);
        dest.writeString(wifiMac);
        dest.writeString(uid);
        dest.writeString(isWifiConnect);
        dest.writeString(count);
        dest.writeString(error);
        dest.writeString(cValue);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<RecordBean> CREATOR = new Creator<RecordBean>() {
        @Override
        public RecordBean createFromParcel(Parcel in) {
            return new RecordBean(in);
        }

        @Override
        public RecordBean[] newArray(int size) {
            return new RecordBean[size];
        }
    };

    public String getcValue() {
        return cValue;
    }

    public void setcValue(String cValue) {
        this.cValue = cValue;
    }

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    public String getWifiMac() {
        return wifiMac;
    }

    public void setWifiMac(String wifiMac) {
        this.wifiMac = wifiMac;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getIsWifiConnect() {
        return isWifiConnect;
    }

    public void setIsWifiConnect(String isWifiConnect) {
        this.isWifiConnect = isWifiConnect;
    }

    public String getCount() {
        return count;
    }

    public void setCount(String count) {
        this.count = count;
    }

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }

    @Override
    public String toString() {
        return "RecordBean{" +
                "productId='" + productId + '\'' +
                ", sn='" + sn + '\'' +
                ", wifiMac='" + wifiMac + '\'' +
                ", uid='" + uid + '\'' +
                ", isWifiConnect='" + isWifiConnect + '\'' +
                ", count='" + count + '\'' +
                ", error='" + error + '\'' +
                ", cValue='" + cValue + '\'' +
                '}';
    }
}
